 {
        
        var o = require("../UIManager/UISoundManager.js");
        cc.Class({
            extends: cc.Component,
            properties: {
                btnClose: {
                    default: null,
                    type: cc.Button
                },
                nodePlayerItem1: {
                    default: null,
                    type: cc.Node
                },
                nodePlayerItem2: {
                    default: null,
                    type: cc.Node
                },
                nodePlayerItem3: {
                    default: null,
                    type: cc.Node
                },
                nodePlayerItem4: {
                    default: null,
                    type: cc.Node
                },
                nodeDetailContent: {
                    default: null,
                    type: cc.Node
                },
                nodeGameResultdetailItem: {
                    default: null,
                    type: cc.Prefab
                }
            },
            onLoad: function () {
                Global.tableModel.getTableType() == Global.config.tableType.CREATE ? this.isShowChangeAndBack(!1) : this.isShowChangeAndBack(!0);
                var e = Global.utils.searchNode(this.node, "btnBlock");
                e.on(cc.Node.EventType.TOUCH_START, this.onTouchStart.bind(this), this), e.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd.bind(this), this),
                    e.on(cc.Node.EventType.TOUCH_CANCEL, this.onTouchCancel.bind(this), this);
            },
            start: function () {
            },
            onShowResult: function (e) {
                this.node.setScale(e);
            },
            onTouchStart: function (e) {
                this.onShowResult(0), e.stopPropagation();
            },
            onTouchEnd: function (e) {
                this.onShowResult(1), e.stopPropagation();
            },
            onTouchCancel: function (e) {
                this.onShowResult(1), e.stopPropagation();
            },
            isShowChangeAndBack: function (e) {
                Global.utils.searchNode(this.node, "btnClose").active = e, Global.utils.searchNode(this.node, "btnChange").active = e;
            },
            onDestroy: function () {
                Global.tableModel.setAllowPopupRotateLuckInGameEnd(!1), Global.notificationCenter.offAll(this);
            },
            bindData: function (e) {
                for (var t = -99999999, n = 0; n < e.infos.length; n++) t < e.infos[n].totalScore && (t = e.infos[n].totalScore);
                for (n = 0; n < e.infos.length; n++) {
                    var o = null;
                    if (0 == n && (o = this.nodePlayerItem1), 1 == n && (o = this.nodePlayerItem2),
                    2 == n && (o = this.nodePlayerItem3), 3 == n && (o = this.nodePlayerItem4), o) o.getComponent("GameResutlItemController").bindData(e.infos[n], t == e.infos[n].totalScore);
                }
                var i = Global.tableModel.getPlayerModel(Global.config.SEAT_DOWN);
                if (i) {
                    var a = i.getDetailInfo();
                    if (a) for (n = 0; n < a.length; n++) {
                        var r = cc.instantiate(this.nodeGameResultdetailItem);
                        this.nodeDetailContent && this.nodeDetailContent.addChild(r), r.getComponent("GameResutlDetileItemController").bindData(a[n]);
                    }
                }
            },
            onClickClose: function () {
                o.playEffect("select"), SceneHelper.loadScene("selectScene");
                var e = Global.tableModel.getRoomId(), t = Global.tableModel.getTableId(),
                    n = Global.tableModel.getSeatId();
                if (0 != e && 0 != t) return cc.error("WaittingController onClickBack", "roomId = " + e + " tableId = " + t + " seatId = " + n),
                    void Global.msgHandler.requestTableLeave(e, t, n);
            },
            onClickChange: function () {
                o.playEffect("select"), Global.utils.showWaitting();
                Global.roomInfoModel.getPlayModel();
                var e = Global.roomInfoModel.getRoomId(), t = Global.tableModel.getTableId(),
                    n = Global.tableModel.getSeatId();
                Global.msgHandler.requestTableLeave(e, t, n), this.quickStart();
            },
            onShowTotalResult: function (e) {
                cc.loader.loadRes("prefabs/nodeGameTotalResult", cc.Prefab, function (t, n) {
                    var i = cc.instantiate(n);
                    console.log("预制节点===", i);
                    var a = Global.utils.searchNode(SceneHelper.getCurScene(), "Node_result");
                    if (a && i) {
                        a.addChild(i, 10), i.setPosition(cc.p(0, 50));
                        var r = i.getComponent("GameTotalResultController");
                        console.log("controller ==", r), r.bindData(e), o.playGameEnd();
                    }
                });
            },
            onClickContinue: function () {
                o.playEffect("select"), Global.utils.showWaitting();
                if (Global.tableModel.getTableType() == Global.config.tableType.CREATE) if (Global.tableModel.getIsShowTotalResult()) {
                    var e = Global.tableModel.getTotalResult();
                    this.onShowTotalResult(e), this.node.active = !1;
                } else {
                    SceneHelper.loadScene("waittingScene", function () {
                        Global.utils.hideWaitting(), Global.msgHandler.requestNextRound(Global.tableModel.getRoomId(), Global.tableModel.getTableId(), Global.tableModel.getSeatId());
                    });
                } else this.quickStart();
            },
            quickStart: function () {
                Global.tableModel.setAllowPopupRotateLuckInGameEnd(!0);
                var e = {
                    playMode: Global.roomInfoModel.getPlayModel() || Global.config.playModel.XUELIU,
                    gameId: Global.config.GAMEID || Global.config.GAMEID_NORMAL,
                    type: "GameResultController quickStart"
                };
                Global.notificationCenter.emit(Global.eventName.MSG_DO_QUICK_START, e);
            },
            onBlockClick: function () {
            }
        })
    }